package com.bonc.rms.dao.impl.tms;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.bonc.rms.dao.tms.ZShortDimissionDao;
import com.bonc.rms.mapper.ZShortDimissionMapper;

@Repository
public class ZShortDimissionDaoImpl implements ZShortDimissionDao {

	@Autowired
	ZShortDimissionMapper zShortDimissionMapper;
	
	/**
	 * 短期离职员工按性别和部门分布
	 */
	@Override
	public Integer getShortDimissionByGender(Integer departmentId, String gender) {
		
		return zShortDimissionMapper.getShortDimissionByGender(departmentId, gender);
	}

	/**
	 * 短期离职员工按年龄和部门分布
	 */
	@Override
	public Integer getShortDimissionByAge(Integer departmentId, String age) {
		
		return zShortDimissionMapper.getShortDimissionByAge(departmentId, age);
	}

	/**
	 * 短期离职员工按学历和部门分布
	 */
	@Override
	public Integer getShortDimissionByDegree(Integer departmentId, String degree) {
		return zShortDimissionMapper.getShortDimissionByDegree(departmentId, degree);
	}

	/**
	 * 短期离职员工按工作经验和部门分布
	 */
	@Override
	public Integer getShortDimissionByWE(Integer departmentId, int min, int max) {
		return zShortDimissionMapper.getShortDimissionByWE(departmentId, min, max);
	}

	/**
	 * 短期离职员工数量前十的一级部门部门(总公司)
	 */
	@Override
	public List<Map<String, String>> getShortDimissionTOPDept() {
		
		return zShortDimissionMapper.getShortDimissionTOPDept();
	}

	/**
	 * 短期离职员工数量前十的二级部门(某一级部门下)
	 */
	@Override
	public List<Map<String, String>> getShortDimissionTOPDeptByDept(Integer departmentId) {

		return zShortDimissionMapper.getShortDimissionTOPDeptByDept(departmentId);

	}

	/**
	 * HC指标
	 * 获取入职类型人数  
	 * 1 - 正式
	 * 2 - 实习
	 */
	@Override
	public List<Map<String, String>> getEntryType(Integer departmentId,
												  Integer entryType, 
												  Date startMonth, 
												  Date endMonth) {
		
		return zShortDimissionMapper.getEntryType(departmentId, entryType, startMonth, endMonth);
	}

	/**
	 * HC周报
	 * 获取入职类型人数  
	 * 1 - 正式
	 * 2 - 实习
	 */
	@Override
	public List<Map<String, String>> getEntryTypeByDate(Integer departmentId,
														Integer entryType, 
														Date startDate, 
														Date endDate) {
		
		return zShortDimissionMapper.getEntryTypeByDate(departmentId, entryType, startDate, endDate);
	}

	/**
	 * 员工按学历和部门分布
	 */
	@Override
	public Integer getDegreeDistribute(Integer departmentId, String degree) {
		
		return zShortDimissionMapper.getDegreeDistribute(departmentId, degree);
	}

	/**
	 * 员工按性别和部门分布
	 */
	@Override
	public Integer getGenderDistribute(Integer departmentId, String gender) {

		return zShortDimissionMapper.getGenderDistribute(departmentId, gender);
	}

	/**
	 * 判断登录用户所属部门是否为叶子结点
	 * 1-是
	 * 0-不是
	 */
	@Override
	public Integer getLeafTag(Integer departmentId) {
	
		return zShortDimissionMapper.getLeafTag(departmentId);
	}

	/**
	 * 判断登录用户所在一级部们所属level
	 */
	@Override
	public Integer getLevelTag(Integer departmentId) {
		
		return zShortDimissionMapper.getLevelTag(departmentId);
	}

	/**
	 * 获取部门 id 对应的部门名称
	 */
	@Override
	public String getDeptName(Integer departmentId) {
		
		return zShortDimissionMapper.getDeptName(departmentId);
	}

	/**
	 * 获取登录用户所在部门的子部门数量
	 */
	@Override
	public Integer getSubDeptNum(Integer departmentId) {
		
		return zShortDimissionMapper.getSubDeptNum(departmentId);
	}



}
